<?
include("../db.php");
include("auth.php");

$id=$_REQUEST['id'];

if ($_REQUEST['thumb'])
	$gay="Thumb";
else
	$gay="Bilde";

$sql = "SELECT $gay FROM Bilder WHERE ID=$id";
$recs=mysql_query($sql);
$rec=mysql_fetch_assoc($recs);

header("Content-type: image/png");
header("Content-Disposition: inline; filename=$gay-$id.png");
echo $rec[$gay];
?>
